/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.api;


import org.proteusframework.api.model.IQualifiedName;
import org.proteusframework.api.model.NoSuchQualifiedNameException;
import org.proteusframework.extension.IAdapterManager;

/**
 * Provides platform-agnostic access to the abstract factory used for requesting concrete
 * factory instances that are capable of producing concrete plugin instances.
 *
 * @author Tacoma Four
 */
public interface IPlatformDelegate
{
    /**
     * Access details about the Proteus runtime engine.
     *
     * @return Runtime engine
     */
    IRuntimeEngine getEngine();


    /**
     * Access the primordial factory registrar, typically an instance of
     * {@link org.proteusframework.runtime.ProteusRegistrar}.
     *
     * @return Factory registrar
     */
    IFactoryRegistrar getFactoryRegistrar();

    /**
     * Access the Proteus Factory Registrar to locate a specific Plugin Registrar.
     *
     * @param qualifiedName Qualified name of the plugin registrar to locate
     * @return Plugin Registrar
     * @throws org.proteusframework.api.model.NoSuchQualifiedNameException
     *          When the registrar has no record of the qualified name
     */
    IPluginRegistrar getPluginRegistrar(IQualifiedName qualifiedName) throws NoSuchQualifiedNameException;

    /**
     * Access the platform adapter manager.
     *
     * @return Adapter manager
     */
    IAdapterManager getAdapterManager();
}
